Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

337
Views
Ansible equivalent of "passwd -l"

I'm trying to lock a user account that I just created with Ansible (it should not be possible to log into this account). I know you can do this using the shell module by running "passwd -l".

Is there a way to do this via the user module, or something similar?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I think that's not possible.

Maybe the following is an option?

 - user: 
     name: someone
     shell: /sbin/nologin

I think this is even more secure than using passwd -l as the latter would only disable the password. The user would still be able to login by ssh key authentication.

over 4 years ago · Santiago Trujillo Report

0

You can use attribute 'password_lock' password_lock: yes

^^ This is the equivalent of 'usermod -L'

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!